// 1.extends
// 2.super
class Animal{
    constructor(name){
        this.name=name;
        this.thirst=100;
        this.belly=[];
    }
    drink(){
        this.thirst-=10;
        return this;
    }
    eat(food){
        this.belly.push(food);
        return this;     
    }
}

class Dog extends Animal{
    constructor(name,breed){
        super(name);
        this.breed=breed;//子类有的 

    }
}
const sunny =new Dog('sunny');
console.log(sunny.name);
sunny //链式调用
    .eat('yy')
    .drink()
console.log(sunny.thirst);
console.log(sunny.belly);